package com.ccx.demo.Controller;


import com.ccx.demo.Vo.Result;
import com.ccx.demo.Vo.ResultService;
import com.ccx.demo.pojo.SysRole;
import com.ccx.demo.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class QueryController {

    @Autowired
    private SysUserService sysUserService;

    @Autowired
    private ResultService resultService;


    @GetMapping("/QueryByRole")
    public Result QueryRole(){
        List<SysRole> sysRoles = sysUserService.QueryByRole();
        return resultService.OK(sysRoles);
    }

}
